>> TGS_phase_analysis('Cr_single_crystal-2019-06-30-06.40um-0degrees#2-POS-1.txt','Cr_single_crystal-2019-06-30-06.40um-0degrees#2-NEG-1.txt',6.4,1)

f2 = 

     General model:
     f2(x) = A.*(erfc(q*sqrt(k*(x+start_time)))-beta*exp(-q^2*k*(x+start_time)
                    )./sqrt((x+start_time)))+B.*sin(2*pi*(peak_freq)*(x+
                    start_time)+p)*exp(-(x+start_time)/t)+D
     Coefficients (with 95% confidence bounds):
       A =     0.02001  (0.01985, 0.02018)
       k =   4.233e-05  (4.181e-05, 4.285e-05)
       beta =   6.593e-14  (fixed at bound)
       B =     0.00401  (0.003915, 0.004105)
       p =       2.965  (2.948, 2.983)
       t =   2.354e-08  (2.27e-08, 2.437e-08)
       D =   6.912e-05  (5.388e-05, 8.435e-05)
     Problem parameters:
       q =   9.817e+05
       start_time =     9.5e-10
       peak_freq =   5.462e+08
Bad fit for:Cr_single_crystal-2019-06-30-06.40um-0degrees#2-POS-1.txt~re: beta

ans =

   5.4616e+08